"""modelProject URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.conf.urls import url, include
from rest_framework.documentation import include_docs_urls

# media
from django.conf.urls.static import static
from django.views.static import serve
from . import settings

urlpatterns = [
    path(u'admin/', admin.site.urls),
    # coreapi 接口文档
    path(u'api-docs/', include_docs_urls(title='接口文档')),
    # 一些列身份认证的接口, 便于在页面认证身份.
    url(r'api-auth/', include('rest_framework.urls')),
    # 门户页
    path("", include("apps.base_config.urls")),
    path("history_qa/", include('history_qa.urls')),
    path("knowledge1/", include('knowledge1.urls'))
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)


# 中文更名
from django.contrib import admin
admin.site.site_header = u"大模型数据管理平台"
admin.site.site_title = u"大模型数据管理平台 | 华院计算"
admin.site.index_title = u"大模型数据管理平台 | 华院计算"

# 如果是调式状态
if settings.DEBUG:
    import debug_toolbar
    urlpatterns = [
        path('__debug__/', include(debug_toolbar.urls)),
    ] + urlpatterns
